1. Field of the Invention
This invention relates to the field of information processing, and in particular to the encoding of script information in electronic versions of documents and files.
2. Description of Related Art
Scripts are used to produce “interactive” documents, such as interactive forms, wherein a user can enter information, click selection buttons, and so on. Various techniques and programming languages have been developed to facilitate the development of scripts. For example, the HyperText Markup Language, HTML, is often used to encode script-enhanced documents. HTML is a collection of platform-independent styles, indicated by markup tags, that define the various components of a document. HTML tags are usually paired, marking the beginning and the end of the elements of the document to which the particular HTML style is applied. One example HTML style is a “FORM” that defines a segment of a document that is used to provide programmed elements for collecting information from a user, corresponding to identified fields on the form. Other scripting languages, some of which include the use of HTML encodings, are also commonly used to provide a programmed effect, such as JAVA, JAVASCRIPT, and so on.
FIG. 1 illustrates an example prior art HTML form file 100 that describes the rendering of an interactive form 200. The file 100 contains an HTML tag pair 110, 180 that defines the beginning and end of the form, respectively. Other segments of information and HTLM styles may precede and succeed the beginning and ending tags 110, 180 within the file 100. The beginning “<FORM” tag 110 includes an identification of a destination 111 to which the user's responses are to be communicated, and other parameters that indicate how the information that the user provides is to be communicated. Between the beginning 110 and end 180 of the form segment are HTML tags 120, 130, 150, 160, 170 that effect the rendering of an interactive form 200, via an HTML compatible application, such as a conventional web browser. The tag 120, for example, effects the rendering of the segment 121 of the document 100 as a centered heading, illustrated as 221 in the rendered form 200. In like manner, the text 131 is rendered as a left justified paragraph 231.
The tags 150 and 160 effect an interactive input field 250 and 260, respectively. The user enters a name in field 250 and an address in field 260. By the programmed effect associated with the tag 150, the name that the user enters in field 250 is assigned to a variable named “UName”, as specified by the “NAME=” entry 151 in the tag 150. In like manner, the address that the user enters in the field 260 is assigned to the variable “UAddress”, as specified by the “NAME=” entry 161 in the tag 160. The tag 170 effects the rendering of a “Submit” button 270. When user clicks on the “Submit” button 270, the HTML-compatible application provides the information assigned to each variable, UName and UAddress, to the destination 111 that is identified in the initial form tag 110.
Note that an application that is not HTML-compatible will not recognize the various tags 110–180, nor will it be able to distinguish information that is intended to be displayed from the HTML control information that is not intended to be displayed. That is, to an application that is not HTML-compatible, the HTML-format file 100 merely appears as a conventional text file. The displayed or printed form of the HTML-format file 100 via such an application will appear similar to the image of the HTML-format file 100 of FIG. 1. That is, all of the HTML-specific information, such as the tags 110, 120, and so on, will appear as part of the displayed document, as well as the text content 121, 131, and so on. Such a direct display of the HTML-format file 100 is visually unappealing, is often undecipherable to a user who is unfamiliar with the raw form of formatted computer files, and is virtually unusable as a form for collecting user information.
Note, also, that, in addition to an HTML-compatible application, the example script-based interactive form 100 requires a corresponding rendering device that can accommodate both a display of the relevant text information 221, 231, etc. as well as the input 250, 260, of user information. Some devices, such as printers, for example, are incompatible with interactive forms.
To provide compatibility among devices having differing capabilities, standards, such as MIME (Multipart Internet Mail Extension), have been developed. Using the MIME format, compatibility is provided by encoding the document in multiple formats. For example, the example document 100 might be encoded using the above HTML-Form encoding, followed by, or preceded by a “plain-text” encoding of the form. As its name implies, the plain-text encoding is an encoding of all of the printable text characters in the form, without any control codes, or tags, to effect the interactive features of the form. To effect the alternative renderings, each of the multiple formats are identified by a segment delimiter that identifies the beginning and end of each segment, the format used to encode the segment, and so on. When a MIME-format file is opened for rendering by an application, the application determines which segment to process, depending upon its capabilities, and the capabilities of the system upon which it is operating, including the capabilities of the device used to effect the rendering. If the application and system support interactive HTML-forms, for example, the application will process the segment of the document 100 between the tags 110, 180 that identify the form. Conversely, if the application or system is incapable of rendering interactive forms, or is not HTML-compatible, the plain-text encoding will be rendered. In this manner, using the MIME-format, applications that are not HTML-compatible can effectively process files that contain HTML segments, or other segments that contain formats that the application does not support, by ignoring the unsupported segments.
The proper display or printing of a document that contains alternative encodings with MIME-compatible segment delimiters, however, presupposes that the application is MIME-compatible. That is, it presupposes that the application recognizes each of the alternative encodings, and selects the appropriate encoding for processing and display. An application that is not MIME-compatible, however, will not recognize the various segments of the document for independent processing, and will typically produce a display that appears similar to the illustrated file 100, that is virtually unreadable.